home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 11.3 KB | 572 lines | [TEXT/MPS ] |
- ;
- ; File: Menus.a
- ;
- ; Contains: Menu Manager Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
- __MENUS__ SET 1
-
- IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
- include 'Memory.a'
- ENDIF
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
-
- noMark EQU 0 ;mark symbol for MarkItem
- ; menu defProc messages
- mDrawMsg EQU 0
- mChooseMsg EQU 1
- mSizeMsg EQU 2
- mDrawItemMsg EQU 4
- mCalcItemMsg EQU 5
- textMenuProc EQU 0
- hMenuCmd EQU 27 ;itemCmd == 0x001B ==> hierarchical menu
- hierMenu EQU -1 ;a hierarchical menu - for InsertMenu call
- mPopUpMsg EQU 3 ;menu defProc messages - place yourself
- mctAllItems EQU -98 ;search for all Items for the given ID
- mctLastIDIndic EQU -99 ;last color table entry has this in ID field
- MenuInfo RECORD 0
- menuID ds.w 1 ; offset: $0 (0)
- menuWidth ds.w 1 ; offset: $2 (2)
- menuHeight ds.w 1 ; offset: $4 (4)
- menuProc ds.l 1 ; offset: $6 (6)
- enableFlags ds.l 1 ; offset: $A (10)
- menuData ds Str255 ; offset: $E (14)
- sizeof EQU * ; size: $10E (270)
- ENDR
- ; typedef struct MenuInfo * MenuPtr
-
- ; typedef MenuPtr * MenuHandle
-
- ; typedef MenuHandle MenuRef
-
- MCEntry RECORD 0
- mctID ds.w 1 ; offset: $0 (0) ; menu ID. ID = 0 is the menu bar
- mctItem ds.w 1 ; offset: $2 (2) ; menu Item. Item = 0 is a title
- mctRGB1 ds RGBColor ; offset: $4 (4) ; usage depends on ID and Item
- mctRGB2 ds RGBColor ; offset: $A (10) ; usage depends on ID and Item
- mctRGB3 ds RGBColor ; offset: $10 (16) ; usage depends on ID and Item
- mctRGB4 ds RGBColor ; offset: $16 (22) ; usage depends on ID and Item
- mctReserved ds.w 1 ; offset: $1C (28) ; reserved for internal use
- sizeof EQU * ; size: $1E (30)
- ENDR
- ; typedef struct MCEntry * MCEntryPtr
-
- MCTable RECORD 0
- elements ds.b 1 * MCEntry.sizeof
- sizeof EQU * ; size: $1E (30)
- ENDR
-
-
- ; typedef struct MCEntry * MCTablePtr
-
- ; typedef MCTablePtr * MCTableHandle
-
- MenuCRsrc RECORD 0
- numEntries ds.w 1 ; offset: $0 (0) ; number of entries
- mcEntryRecs ds MCTable ; offset: $2 (2) ; ARRAY [1..numEntries] of MCEntry
- sizeof EQU * ; size: $20 (32)
- ENDR
- ; typedef struct MenuCRsrc * MenuCRsrcPtr
-
- ; typedef MenuCRsrcPtr * MenuCRsrcHandle
-
- ;
- ; pascal short GetMBarHeight(void)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetMBarHeight &dest=(sp)
- move.w $0BAA,&dest
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetMBarHeight
- ENDIF
-
- ;
- ; pascal MenuRef NewMenu(short menuID, ConstStr255Param menuTitle)
- ;
- IF ¬ GENERATINGCFM THEN
- _NewMenu: OPWORD $A931
- ELSE
- IMPORT_CFM_FUNCTION NewMenu
- ENDIF
-
- ;
- ; pascal MenuRef GetMenu(short resourceID)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetMenu: OPWORD $A9BF
- ELSE
- IMPORT_CFM_FUNCTION GetMenu
- ENDIF
-
- ;
- ; pascal void AppendMenu(MenuRef menu, ConstStr255Param data)
- ;
- IF ¬ GENERATINGCFM THEN
- _AppendMenu: OPWORD $A933
- ELSE
- IMPORT_CFM_FUNCTION AppendMenu
- ENDIF
-
- ;
- ; pascal void InsertMenu(MenuRef theMenu, short beforeID)
- ;
- IF ¬ GENERATINGCFM THEN
- _InsertMenu: OPWORD $A935
- ELSE
- IMPORT_CFM_FUNCTION InsertMenu
- ENDIF
-
- ;
- ; pascal void DeleteMenu(short menuID)
- ;
- IF ¬ GENERATINGCFM THEN
- _DeleteMenu: OPWORD $A936
- ELSE
- IMPORT_CFM_FUNCTION DeleteMenu
- ENDIF
-
- ;
- ; pascal void AppendResMenu(MenuRef theMenu, ResType theType)
- ;
- IF ¬ GENERATINGCFM THEN
- _AppendResMenu: OPWORD $A94D
- ELSE
- IMPORT_CFM_FUNCTION AppendResMenu
- ENDIF
-
- ;
- ; pascal void InsertMenuItem(MenuRef theMenu, ConstStr255Param itemString, short afterItem)
- ;
- IF ¬ GENERATINGCFM THEN
- _InsertMenuItem: OPWORD $A826
- ELSE
- IMPORT_CFM_FUNCTION InsertMenuItem
- ENDIF
-
- ;
- ; pascal void SetMenuItemText(MenuRef theMenu, short item, ConstStr255Param itemString)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetMenuItemText: OPWORD $A947
- ELSE
- IMPORT_CFM_FUNCTION SetMenuItemText
- ENDIF
-
- ;
- ; pascal void GetMenuItemText(MenuRef theMenu, short item, Str255 itemString)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetMenuItemText: OPWORD $A946
- ELSE
- IMPORT_CFM_FUNCTION GetMenuItemText
- ENDIF
-
- ;
- ; pascal void SetItemMark(MenuRef theMenu, short item, CharParameter markChar)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetItemMark: OPWORD $A944
- ELSE
- IMPORT_CFM_FUNCTION SetItemMark
- ENDIF
-
- ;
- ; pascal void GetItemMark(MenuRef theMenu, short item, CharParameter *markChar)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetItemMark: OPWORD $A943
- ELSE
- IMPORT_CFM_FUNCTION GetItemMark
- ENDIF
-
- ;
- ; pascal void SetItemCmd(MenuRef theMenu, short item, CharParameter cmdChar)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetItemCmd: OPWORD $A84F
- ELSE
- IMPORT_CFM_FUNCTION SetItemCmd
- ENDIF
-
- ;
- ; pascal void GetItemCmd(MenuRef theMenu, short item, CharParameter *cmdChar)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetItemCmd: OPWORD $A84E
- ELSE
- IMPORT_CFM_FUNCTION GetItemCmd
- ENDIF
-
- ;
- ; pascal void SetItemIcon(MenuRef theMenu, short item, short iconIndex)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetItemIcon: OPWORD $A940
- ELSE
- IMPORT_CFM_FUNCTION SetItemIcon
- ENDIF
-
- ;
- ; pascal void GetItemIcon(MenuRef theMenu, short item, short *iconIndex)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetItemIcon: OPWORD $A93F
- ELSE
- IMPORT_CFM_FUNCTION GetItemIcon
- ENDIF
-
- ;
- ; pascal void SetItemStyle(MenuRef theMenu, short item, StyleParameter chStyle)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetItemStyle: OPWORD $A942
- ELSE
- IMPORT_CFM_FUNCTION SetItemStyle
- ENDIF
-
- ;
- ; pascal void GetItemStyle(MenuRef theMenu, short item, Style *chStyle)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetItemStyle: OPWORD $A941
- ELSE
- IMPORT_CFM_FUNCTION GetItemStyle
- ENDIF
-
- ;
- ; pascal MenuRef GetMenuHandle(short menuID)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetMenuHandle: OPWORD $A949
- ELSE
- IMPORT_CFM_FUNCTION GetMenuHandle
- ENDIF
-
- ;
- ; pascal void CalcMenuSize(MenuRef theMenu)
- ;
- IF ¬ GENERATINGCFM THEN
- _CalcMenuSize: OPWORD $A948
- ELSE
- IMPORT_CFM_FUNCTION CalcMenuSize
- ENDIF
-
- ;
- ; pascal void DisableItem(MenuRef theMenu, short item)
- ;
- IF ¬ GENERATINGCFM THEN
- _DisableItem: OPWORD $A93A
- ELSE
- IMPORT_CFM_FUNCTION DisableItem
- ENDIF
-
- ;
- ; pascal void EnableItem(MenuRef theMenu, short item)
- ;
- IF ¬ GENERATINGCFM THEN
- _EnableItem: OPWORD $A939
- ELSE
- IMPORT_CFM_FUNCTION EnableItem
- ENDIF
-
- ;
- ; pascal void FlashMenuBar(short menuID)
- ;
- IF ¬ GENERATINGCFM THEN
- _FlashMenuBar: OPWORD $A94C
- ELSE
- IMPORT_CFM_FUNCTION FlashMenuBar
- ENDIF
-
- ;
- ; pascal long PopUpMenuSelect(MenuRef menu, short top, short left, short popUpItem)
- ;
- IF ¬ GENERATINGCFM THEN
- _PopUpMenuSelect: OPWORD $A80B
- ELSE
- IMPORT_CFM_FUNCTION PopUpMenuSelect
- ENDIF
-
- ;
- ; pascal void DeleteMCEntries(short menuID, short menuItem)
- ;
- IF ¬ GENERATINGCFM THEN
- _DeleteMCEntries: OPWORD $AA60
- ELSE
- IMPORT_CFM_FUNCTION DeleteMCEntries
- ENDIF
-
- ;
- ; pascal MCTableHandle GetMCInfo(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _GetMCInfo: OPWORD $AA61
- ELSE
- IMPORT_CFM_FUNCTION GetMCInfo
- ENDIF
-
- ;
- ; pascal void SetMCInfo(MCTableHandle menuCTbl)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetMCInfo: OPWORD $AA62
- ELSE
- IMPORT_CFM_FUNCTION SetMCInfo
- ENDIF
-
- ;
- ; pascal void DisposeMCInfo(MCTableHandle menuCTbl)
- ;
- IF ¬ GENERATINGCFM THEN
- _DisposeMCInfo: OPWORD $AA63
- ELSE
- IMPORT_CFM_FUNCTION DisposeMCInfo
- ENDIF
-
- ;
- ; pascal MCEntryPtr GetMCEntry(short menuID, short menuItem)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetMCEntry: OPWORD $AA64
- ELSE
- IMPORT_CFM_FUNCTION GetMCEntry
- ENDIF
-
- ;
- ; pascal void SetMCEntries(short numEntries, MCTablePtr menuCEntries)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetMCEntries: OPWORD $AA65
- ELSE
- IMPORT_CFM_FUNCTION SetMCEntries
- ENDIF
-
- ;
- ; pascal void DrawMenuBar(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _DrawMenuBar: OPWORD $A937
- ELSE
- IMPORT_CFM_FUNCTION DrawMenuBar
- ENDIF
-
- ;
- ; pascal void InvalMenuBar(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _InvalMenuBar: OPWORD $A81D
- ELSE
- IMPORT_CFM_FUNCTION InvalMenuBar
- ENDIF
-
- ;
- ; pascal void InitProcMenu(short resID)
- ;
- IF ¬ GENERATINGCFM THEN
- _InitProcMenu: OPWORD $A808
- ELSE
- IMPORT_CFM_FUNCTION InitProcMenu
- ENDIF
-
- ;
- ; pascal Handle GetMenuBar(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _GetMenuBar: OPWORD $A93B
- ELSE
- IMPORT_CFM_FUNCTION GetMenuBar
- ENDIF
-
- ;
- ; pascal void SetMenuBar(Handle menuList)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetMenuBar: OPWORD $A93C
- ELSE
- IMPORT_CFM_FUNCTION SetMenuBar
- ENDIF
-
- ;
- ; pascal Boolean SystemEdit(short editCmd)
- ;
- IF ¬ GENERATINGCFM THEN
- _SystemEdit: OPWORD $A9C2
- ELSE
- IMPORT_CFM_FUNCTION SystemEdit
- ENDIF
-
- ;
- ; pascal void SystemMenu(long menuResult)
- ;
- IF ¬ GENERATINGCFM THEN
- _SystemMenu: OPWORD $A9B5
- ELSE
- IMPORT_CFM_FUNCTION SystemMenu
- ENDIF
-
- ;
- ; pascal Handle GetNewMBar(short menuBarID)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetNewMBar: OPWORD $A9C0
- ELSE
- IMPORT_CFM_FUNCTION GetNewMBar
- ENDIF
-
- ;
- ; pascal void ClearMenuBar(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _ClearMenuBar: OPWORD $A934
- ELSE
- IMPORT_CFM_FUNCTION ClearMenuBar
- ENDIF
-
- ;
- ; pascal void CheckItem(MenuRef theMenu, short item, Boolean checked)
- ;
- IF ¬ GENERATINGCFM THEN
- _CheckItem: OPWORD $A945
- ELSE
- IMPORT_CFM_FUNCTION CheckItem
- ENDIF
-
- ;
- ; pascal short CountMItems(MenuRef theMenu)
- ;
- IF ¬ GENERATINGCFM THEN
- _CountMItems: OPWORD $A950
- ELSE
- IMPORT_CFM_FUNCTION CountMItems
- ENDIF
-
- ;
- ; pascal void SetMenuFlash(short count)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetMenuFlash: OPWORD $A94A
- ELSE
- IMPORT_CFM_FUNCTION SetMenuFlash
- ENDIF
-
- ;
- ; pascal void InitMenus(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _InitMenus: OPWORD $A930
- ELSE
- IMPORT_CFM_FUNCTION InitMenus
- ENDIF
-
- IF OLDROUTINENAMES THEN
- ENDIF
- ;
- ; pascal long MenuKey(CharParameter ch)
- ;
- IF ¬ GENERATINGCFM THEN
- _MenuKey: OPWORD $A93E
- ELSE
- IMPORT_CFM_FUNCTION MenuKey
- ENDIF
-
- ;
- ; pascal long MenuSelect(Point startPt)
- ;
- IF ¬ GENERATINGCFM THEN
- _MenuSelect: OPWORD $A93D
- ELSE
- IMPORT_CFM_FUNCTION MenuSelect
- ENDIF
-
- ;
- ; pascal long MenuChoice(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _MenuChoice: OPWORD $AA66
- ELSE
- IMPORT_CFM_FUNCTION MenuChoice
- ENDIF
-
- ;
- ; pascal void DisposeMenu(MenuRef theMenu)
- ;
- IF ¬ GENERATINGCFM THEN
- _DisposeMenu: OPWORD $A932
- ELSE
- IMPORT_CFM_FUNCTION DisposeMenu
- ENDIF
-
- ;
- ; pascal void DeleteMenuItem(MenuRef theMenu, short item)
- ;
- IF ¬ GENERATINGCFM THEN
- _DeleteMenuItem: OPWORD $A952
- ELSE
- IMPORT_CFM_FUNCTION DeleteMenuItem
- ENDIF
-
- ;
- ; pascal void HiliteMenu(short menuID)
- ;
- IF ¬ GENERATINGCFM THEN
- _HiliteMenu: OPWORD $A938
- ELSE
- IMPORT_CFM_FUNCTION HiliteMenu
- ENDIF
-
- ;
- ; pascal void InsertResMenu(MenuRef theMenu, ResType theType, short afterItem)
- ;
- IF ¬ GENERATINGCFM THEN
- _InsertResMenu: OPWORD $A951
- ELSE
- IMPORT_CFM_FUNCTION InsertResMenu
- ENDIF
-
- ;
- ; pascal void InsertFontResMenu(MenuRef theMenu, short afterItem, short scriptFilter)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _InsertFontResMenu
- move.w #$0400,D0
- dc.w $A825
- EndM
- ELSE
- IMPORT_CFM_FUNCTION InsertFontResMenu
- ENDIF
-
- ;
- ; pascal void InsertIntlResMenu(MenuRef theMenu, ResType theType, short afterItem, short scriptFilter)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _InsertIntlResMenu
- move.w #$0601,D0
- dc.w $A825
- EndM
- ELSE
- IMPORT_CFM_FUNCTION InsertIntlResMenu
- ENDIF
-
- ENDIF
- ENDIF ; __MENUS__
-
-